package com.atguigu.tingshu.user.service;

import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import com.atguigu.tingshu.vo.user.UserPaidRecordVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

public interface UserInfoService extends IService<UserInfo> {

    /**
     * 根据用户Id获取用户登录信息
     * @param userId
     * @return
     */
    UserInfoVo getUserInfoVo(Long userId);

    /**
     *  判断用户是否购买声音列表
     * @param userId
     * @param albumId
     * @param trackIdList
     * @return
     */
    Map<Long, Integer> userIsPaidTrack(Long userId, Long albumId, List<Long> trackIdList);

    /**
     *  判断用户是否购买专辑
     * @param albumId
     * @param userId
     * @return
     */
    Boolean isPaidAlbum(Long albumId, Long userId);

    /**
     *  获取用户购买声音id集合
     * @param albumId
     * @param userId
     * @return
     */
    List<Long> findUserPaidTrackList(Long albumId, Long userId);

    /**
     *  记录用户购买信息
     * @param userPaidRecordVo
     */
    void savePaidRecord(UserPaidRecordVo userPaidRecordVo);
}
